package com.ruoyi.archive.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.archive.mapper.ArchiveRoomHistoryMapper;
import com.ruoyi.archive.domain.ArchiveRoomHistory;
import com.ruoyi.archive.service.IArchiveRoomHistoryService;

/**
 * 变更记录Service业务层处理
 * 
 * @author yepanpan
 * @date 2025-04-17
 */
@Service
public class ArchiveRoomHistoryServiceImpl implements IArchiveRoomHistoryService 
{
    private static final Logger log = LoggerFactory.getLogger(ArchiveRoomHistoryServiceImpl.class);

    @Autowired
    private ArchiveRoomHistoryMapper archiveRoomHistoryMapper;

    /**
     * 查询变更记录
     * 
     * @param id 变更记录主键
     * @return 变更记录
     */
    @Override
    public ArchiveRoomHistory selectArchiveRoomHistoryById(Long id)
    {
        return archiveRoomHistoryMapper.selectArchiveRoomHistoryById(id);
    }

    /**
     * 查询变更记录列表
     * 
     * @param archiveRoomHistory 变更记录
     * @return 变更记录
     */
    @Override
    public List<ArchiveRoomHistory> selectArchiveRoomHistoryList(ArchiveRoomHistory archiveRoomHistory)
    {
        return archiveRoomHistoryMapper.selectArchiveRoomHistoryList(archiveRoomHistory);
    }

    /**
     * 新增变更记录
     * 
     * @param archiveRoomHistory 变更记录
     * @return 结果
     */
    @Override
    public int insertArchiveRoomHistory(ArchiveRoomHistory archiveRoomHistory)
    {
        archiveRoomHistory.setCreateTime(DateUtils.getNowDate());
        return archiveRoomHistoryMapper.insertArchiveRoomHistory(archiveRoomHistory);
    }

    /**
     * 修改变更记录
     * 
     * @param archiveRoomHistory 变更记录
     * @return 结果
     */
    @Override
    public int updateArchiveRoomHistory(ArchiveRoomHistory archiveRoomHistory)
    {
        archiveRoomHistory.setUpdateTime(DateUtils.getNowDate());
        return archiveRoomHistoryMapper.updateArchiveRoomHistory(archiveRoomHistory);
    }

    /**
     * 批量删除变更记录
     * 
     * @param ids 需要删除的变更记录主键
     * @return 结果
     */
    @Override
    public int deleteArchiveRoomHistoryByIds(Long[] ids)
    {
        return archiveRoomHistoryMapper.deleteArchiveRoomHistoryByIds(ids);
    }

    /**
     * 删除变更记录信息
     * 
     * @param id 变更记录主键
     * @return 结果
     */
    @Override
    public int deleteArchiveRoomHistoryById(Long id)
    {
        return archiveRoomHistoryMapper.deleteArchiveRoomHistoryById(id);
    }


}
